<template>
	<view class="container padding">
		<view class="itemGroup ">
			<view class="line padding" @click="click(1)">
				<image class="icon-normal" src="../../static/minehome.png"></image>
				<text class="text-light-black-16 bigEmpty padding">商务合作</text>
				<image class="icon-small" src="../../static/smallarrow.png"></image>
			</view>
			<view class="lineGray"></view>

			<view class="line padding" @click="click(2)">
				<image class="icon-normal" src="../../static/minestare.png"></image>
				<text class="text-light-black-16 bigEmpty padding">客服</text>
				<image class="icon-small" src="../../static/smallarrow.png"></image>
			</view>
			<view class="lineGray"></view>

			<view class="line padding" @click="click(3)">
				<image class="icon-normal" src="../../static/mineinvite.png"></image>
				<text class="text-light-black-16 bigEmpty padding">问题反馈</text>
				<image class="icon-small" src="../../static/smallarrow.png"></image>
			</view>
		</view>
		<view class="centerGroup dialogBg" v-show="showDialog">
			<view class="itemGroup dialog padding">

				<view class="centerGroup textBlack18"> {{dialogTitle}}</view>
				<view class="centerGroup marginTop">
					<image src="../../static/qrcode.png"></image>
				</view>
				<!-- <view class="centerGroup marginTop">微信号：sheji001</view> -->
				<view class="centerGroup marginTop">
					<view class="centerGroup canle textblack14" @click="canleDialog">取消</view>
					<view v-show="contact" class="centerGroup ok marginLeft textwhite14" @click="okDialog">去联系</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				contact: false,
				name: "请登录",
				avator: "../../static/personAvatar.png",
				level: 0,
				showDialog: false,
				dialogTitle: ""
			}
		},
		onReady: function() {
			this.name = uni.getStorageSync("name");
			this.avator = uni.getStorageSync("avator");
			// #ifdef MP
			this.contact = true
			// #endif
		},
		onShareAppMessage(res) {
			return {
				title: '设辑-产品设计智能生成AI',
				path: '/pages/HomePage/HomePage',
				imageUrl: '/static/black-logo.png'
			}
		},
		// 自定义页面的分享到朋友圈
		onShareTimeline(res) {
			return {
				title: '设辑-产品设计智能生成AI',
				path: '/pages/HomePage/HomePage',
				imageUrl: '/static/black-logo.png'
			}
		},
		methods: {



			okDialog() {
				this.showDialog = false;

				uni.openCustomerServiceChat({
					corpId: "ww2fb1f9185008afa3",
					extInfo: {
						url: "https://work.weixin.qq.com/kfid/kfc2fde04b0fa7f99f6"
					},
					success: function(e) {
						console.log('e', e)
					},
					fail: function(err) {
						console.log('err', err)
					}
				})
				console.log("open url")

			},
			canleDialog() {
				this.showDialog = false;
			},
			click(id) {

				// #ifdef MP
				this.okDialog();
				// #endif


				// #ifdef H5
				this.showDialog = true;

				switch (id) {
					case 1:
						this.dialogTitle = "商务合作";
						break
					case 2:
						this.dialogTitle = "客服";
						break
					case 3:
						this.dialogTitle = "问题反馈";
						break
				}
				// #endif



			}

		}
	}
</script>

<style>
	@import "../../common/uni.css";

	.container {
		background: #F4F4F4;
		height: 100vh;
		margin: 0;
	}
</style>